/*     */ package com.qmsk.business.member.shopMember.dao;
/*     */ 
/*     */ import com.qmsk.business.sys.basic.SupportDAO;
/*     */ import com.utils.gson.in.GsonHeadOneRow;
/*     */ import com.utils.gson.out.GsonEbRst;
/*     */ import java.sql.SQLException;
/*     */ import java.util.HashMap;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class ShopMemberDAO extends SupportDAO
/*     */ {
/*     */   public GsonEbRst getGsonOfCarTypeId(Integer ctId)
/*     */     throws SQLException
/*     */   {
/*  36 */     Object[] params = { ctId };
/*  37 */     return getGsonOfParams("select_levelID", "json_levelID", params);
/*     */   }
/*     */ 
/*     */   public Integer insertParams(Object[] params) throws SQLException {
/*  41 */     return Integer.valueOf(update("insert_shop_member", 
/*  42 */       params));
/*     */   }
/*     */ 
/*     */   public boolean isExistsOfShopIdLicense(Long shopId, String license) throws SQLException
/*     */   {
/*  47 */     Object[] params = { shopId, license };
/*  48 */     return (queryForInt("ExistsOfLicenseShopId", params, Integer.valueOf(0)).intValue() > 0);
/*     */   }
/*     */ 
/*     */   public boolean isExistsOfGroupIdLicense(Long groupId, String license)
/*     */     throws SQLException
/*     */   {
/*  54 */     Object[] params = { groupId, license };
/*  55 */     return (queryForInt("ExistsOfLicenseGroupId", params, Integer.valueOf(0)).intValue() > 0);
/*     */   }
/*     */ 
/*     */   public boolean isExistsOfCustIdMemberId(Long lMemberId, String CustId)
/*     */     throws SQLException
/*     */   {
/*  61 */     Object[] params = { lMemberId, CustId };
/*  62 */     return (queryForInt("ExistsOfCustIdMemberId", params, Integer.valueOf(0)).intValue() > 0);
/*     */   }
/*     */ 
/*     */   public Long getMemberIdOfGroupIdLicense(Long groupId, String license)
/*     */     throws SQLException
/*     */   {
/*  68 */     Object[] params = { groupId, license };
/*  69 */     return queryForLong("MemberIdOfGroupIdLicense", params, null);
/*     */   }
/*     */ 
/*     */   public Long getMemberIdOfShopIdLicense(Long shopId, String license) throws SQLException
/*     */   {
/*  74 */     Object[] params = { shopId, license };
/*  75 */     return queryForLong("MemberIdOfShopIdLicense", params, null);
/*     */   }
/*     */ 
/*     */   public Integer deleteOfMemberId(Object[] objects) throws SQLException {
/*  79 */     String[] head = { "memberId" };
/*  80 */     return Integer.valueOf(deleteHeadData(head, objects));
/*     */   }
/*     */ 
/*     */   public int getCardNoIsExsit(Object memberCardNo, Object shopId) throws SQLException
/*     */   {
/*  85 */     Object[] params = { shopId, memberCardNo };
/*  86 */     return queryForInt("selectCardNoIsExsit", params, Integer.valueOf(0)).intValue();
/*     */   }
/*     */ 
/*     */   public int updateMemberCashCoup(Double sum, Long memberID, Long shopId)
/*     */     throws SQLException
/*     */   {
/*  95 */     Object[] params = { sum, memberID, shopId };
/*  96 */     return update("updateMemberCashCoup", params);
/*     */   }
/*     */ 
/*     */   public int update_DopositAmountInc(Map<String, ?> params) throws SQLException
/*     */   {
/* 101 */     return update("update_DopositAmountInc", params);
/*     */   }
/*     */ 
/*     */   public int updateDopositCashCoupInc(Map<String, Object> params) throws SQLException
/*     */   {
/* 106 */     return update("updateDopositCashCoupInc", params);
/*     */   }
/*     */ 
/*     */   public int updateIntrCashCoupSub(Map<String, Object> params) throws SQLException
/*     */   {
/* 111 */     return update("updateIntrCashCoupSub", params);
/*     */   }
/*     */ 
/*     */   public int updateDopositAmountInc(Long memberId, Double amount, Long shopId) throws SQLException
/*     */   {
/* 116 */     int nResult = 0;
/* 117 */     Map params = new HashMap();
/*     */     try {
/* 119 */       params.put("memberId", memberId);
/* 120 */       params.put("amount", amount);
/* 121 */       params.put("shopId", shopId);
/* 122 */       nResult += update_DopositAmountInc(params);
/*     */     } finally {
/* 124 */       params.clear();
/* 125 */       params = null;
/*     */     }
/* 127 */     return nResult;
/*     */   }
/*     */ 
/*     */   public int updateMemberIntAmt(Integer sum, Long memberID, Long shopId)
/*     */     throws SQLException
/*     */   {
/* 139 */     Object[] params = { sum, memberID, shopId };
/* 140 */     return update("updateMemberIt", params);
/*     */   }
/*     */ 
/*     */   public int updateMemberInc(Long memberId, Double dActual, Long shopId)
/*     */     throws SQLException
/*     */   {
/* 152 */     Object[] params = { dActual, memberId, shopId };
/* 153 */     return update("updateMemberInc", params);
/*     */   }
/*     */ 
/*     */   public Double getDopositOfMemberId(Long memberId, Long shopId)
/*     */     throws SQLException
/*     */   {
/* 165 */     Object[] params = { memberId, shopId };
/* 166 */     return queryForDouble("selectSqlDopositOfMemberId", params, null);
/*     */   }
/*     */ 
/*     */   public Integer getLevelIdNormal(Object memberId, Integer stId, Long shopId) throws SQLException
/*     */   {
/* 171 */     Map params = new HashMap();
/* 172 */     params.put("memberId", memberId);
/* 173 */     params.put("shopId", shopId);
/* 174 */     if (stId.intValue() == 1) {
/* 175 */       int[] status = { 1, 
/* 176 */         2, 3, 
/* 177 */         4, 5, 
/* 178 */         6 };
/* 179 */       params.put("status", status);
/*     */     } else {
/* 181 */       params.put("status", Integer.valueOf(2));
/*     */     }
/* 183 */     return queryForInt("selectSqlNormalLevelID", params, Integer.valueOf(0));
/*     */   }
/*     */ 
/*     */   public int updateBillMemberIntAmt(Long memberId, Integer intAmt, Long shopId) throws SQLException
/*     */   {
/* 188 */     int nResult = 0;
/* 189 */     Map params = new HashMap();
/*     */     try {
/* 191 */       params.put("memberId", memberId);
/* 192 */       params.put("intAmt", intAmt);
/* 193 */       params.put("shopId", shopId);
/* 194 */       nResult += updateBissBillAmountInc(params);
/*     */     } finally {
/* 196 */       params.clear();
/* 197 */       params = null;
/*     */     }
/* 199 */     return nResult;
/*     */   }
/*     */ 
/*     */   public int updateBissBillAmountInc(Map<String, ?> params) throws SQLException
/*     */   {
/* 204 */     return update("update_IntegralAmount", params);
/*     */   }
/*     */ 
/*     */   public int updateBissBillCashConp(Long memberId, Double cashCoup, Long shopId) throws SQLException
/*     */   {
/* 209 */     int nResult = 0;
/* 210 */     Map params = new HashMap();
/*     */     try {
/* 212 */       params.put("memberId", memberId);
/* 213 */       params.put("shopId", shopId);
/* 214 */       params.put("cashCoup", cashCoup);
/* 215 */       nResult += updateBissBillCashConpAmt(params);
/*     */     } finally {
/* 217 */       params.clear();
/* 218 */       params = null;
/*     */     }
/* 220 */     return nResult;
/*     */   }
/*     */ 
/*     */   public int updateBissBillCashConpAmt(Map<String, ?> params) throws SQLException
/*     */   {
/* 225 */     return update("updateMemberCashConpAmt", params);
/*     */   }
/*     */ 
/*     */   public int updateDopositAmount(Map<String, ?> params) throws SQLException {
/* 229 */     return update("update_DopositAmount", params);
/*     */   }
/*     */ 
/*     */   public int updateDopositAmountOfDisCout(Long memberId, Double amount, Long shopId, Double disCount) throws SQLException
/*     */   {
/* 234 */     Map params = new HashMap();
/* 235 */     params.put("memberId", memberId);
/* 236 */     params.put("amount", amount);
/* 237 */     params.put("shopId", shopId);
/* 238 */     params.put("disCout", disCount);
/* 239 */     return update("updateDopositAmountOfDisCout", params);
/*     */   }
/*     */ 
/*     */   public int updateMbBusBIllDeposit(Long memberId, Double amount, Long shopId) throws SQLException
/*     */   {
/* 244 */     int nResult = 0;
/* 245 */     Map params = new HashMap();
/*     */     try {
/* 247 */       params.put("memberId", memberId);
/* 248 */       params.put("amount", amount);
/* 249 */       params.put("shopId", shopId);
/* 250 */       nResult += updateDopositAmount(params);
/*     */     } finally {
/* 252 */       params.clear();
/* 253 */       params = null;
/*     */     }
/* 255 */     return nResult;
/*     */   }
/*     */ 
/*     */   public GsonHeadOneRow getPaidOneRowOfMemberId(Object memberId, Long shopId) throws SQLException
/*     */   {
/* 260 */     Object[] params = { memberId, shopId };
/* 261 */     return getOneRowOfParams("selectSqlOneRowOfMemberId", 
/* 262 */       "selectJsonOneRowOfMemberId", params);
/*     */   }
/*     */ 
/*     */   public Double getShopMemberDeposit(Long shopId, Long memberId) throws SQLException
/*     */   {
/* 267 */     Object[] params = { memberId, shopId };
/* 268 */     return queryForDouble("selectShopMemberDeposit", params, Double.valueOf(0.0D));
/*     */   }
/*     */ 
/*     */   public double getIsMoneyToNull(Long id, Long shopId) throws SQLException {
/* 272 */     Object[] params = { id, shopId };
/* 273 */     return queryForDouble("selectMoneyToNull", params, Double.valueOf(0.0D)).doubleValue();
/*     */   }
/*     */ 
/*     */   public Integer updateCardNo(Long memberId, Long shopId, String cardNo) throws SQLException
/*     */   {
/* 278 */     Object[] params = { cardNo, memberId, shopId };
/* 279 */     return Integer.valueOf(update("updateCardNo", params));
/*     */   }
/*     */ 
/*     */   public boolean existsShopMemberOfId(Long memberId, Long shopId) throws SQLException
/*     */   {
/* 284 */     Object[] params = { memberId, shopId };
/* 285 */     return queryForBoolean("existsShopMemberOfId", params, Boolean.valueOf(false)).booleanValue();
/*     */   }
/*     */ 
/*     */   public GsonEbRst getGsonOfShopIdOpt1(Map<String, ?> params, Integer nPageIdx, Short nPageSize) throws SQLException
/*     */   {
/* 290 */     return getGsonOfParams("select_cust_of_opt1", params, nPageIdx, 
/* 291 */       nPageSize, true);
/*     */   }
/*     */ 
/*     */   public int updateMemberStatusNormal(Long memberId, String memberCardNO, Long shopId) throws SQLException
/*     */   {
/* 296 */     if (memberCardNO != null) {
/* 297 */       Object[] params = new Object[] { memberCardNO, 
/* 298 */         Integer.valueOf(2), memberId, shopId };
/* 299 */       return update("updateMemberStatusNormall", params);
/*     */     }
/* 301 */     Object[] params = { Integer.valueOf(2), memberId, 
/* 302 */       shopId };
/* 303 */     return update("updateMemberStatusNormal", params);
/*     */   }
/*     */ 
/*     */   public int updateMemberStatus(Integer state, Long memberId, Long shopId)
/*     */     throws SQLException
/*     */   {
/* 309 */     Object[] params = { state, memberId, shopId };
/* 310 */     return update("updateMemberStatusNormal", params);
/*     */   }
/*     */ 
/*     */   public GsonHeadOneRow getMemberInfoOfMemberId(Long memberId, Long shopId)
/*     */     throws SQLException
/*     */   {
/* 316 */     Object[] params = { memberId, shopId };
/* 317 */     return getOneRowOfParams("selectMemberInfoOfmemberId", params);
/*     */   }
/*     */ 
/*     */   public GsonEbRst getGsonOfShopIdAndOpenId(String openId, Long shopId) throws SQLException
/*     */   {
/* 322 */     Object[] params = { openId, shopId };
/* 323 */     return getGsonOfParams("selectSQLShopIdAndOpenId", params, false);
/*     */   }
/*     */ 
/*     */   public GsonHeadOneRow getGsonOnRowOfShopIdAndOpenId(String openId, Long shopId) throws SQLException {
/* 327 */     Object[] params = { openId, shopId };
/* 328 */     return getOneRowOfParams("selectSQLShopIdAndOpenId", params);
/*     */   }
/*     */ 
/*     */   public GsonEbRst getMemberCardInfoByShopIdAndOpenId(Long shopId, String openId)
/*     */     throws SQLException
/*     */   {
/* 344 */     Map params = new HashMap();
/* 345 */     params.put("shopId", shopId);
/* 346 */     params.put("openId", openId);
/* 347 */     return getGsonOfParams("selectSqlOfMemberCardInfo", params, false);
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.member.shopMember.dao.ShopMemberDAO
 * JD-Core Version:    0.5.3
 */